package com.example.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mybatisplus.pojo.StockInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface StockMapper extends BaseMapper<StockInfo> {
    /**
     * 根据商品码查找库存数量
     * @param goodCode
     * @return
     */
    Integer findCountByGoodCode(String goodCode);

    /**
     * 更新商品库存数量
     * @param id
     * @param count
     * @return
     */
    Integer updateStockById(@Param("id") Long id, @Param("count") Integer count);
}
